<script>

$(document).ready(function(){
        selectDiv();
        $('#tipo').change(function() {
            selectDiv();


        });


    });
    
    function selectDiv(){
        
        if($('#tipo option:selected').val()==9){
            $('#cual').show("slow");
            
        }else{
            $('#cual').hide("slow");
            $('#WaterPollOtroCual').attr('value','');
        }
        
    } 

</script>
<div  id="loadimg" style="display: none;">
    <?php echo $html->image('loading.gif', array('border' => "0", 'align' => 'center')); ?>
</div>

<?php echo $form->create('WatersPolls');  ?>
<?php echo $form->hidden("WaterPoll.poll_id");?>
<?php echo $form->input("WaterPoll.water_source_id",array('options'=>$water_sources,'label'=>'Fuente','id'=>'tipo' ));?>
<div  id="cual" style="display: none;">
    <?php  echo $form->input("WaterPoll.otro_cual"); ?>
</div>
<?php echo $form->input("WaterPoll.caudal");?>

<?php echo $form->input("WaterPoll.uso_domestico",array('type'=>'checkbox','value'=>1));?>
<?php echo $form->input("WaterPoll.uso_agricultura",array('type'=>'checkbox','value'=>1));?>
<?php echo $form->input("WaterPoll.uso_ganaderia",array('type'=>'checkbox','value'=>1));?>
<?php echo $form->input("WaterPoll.uso_piscicola",array('type'=>'checkbox','value'=>1));?>
<?php echo $form->input("WaterPoll.disponibilidad",array('options'=>array('Temporal'=>'Temporal','Permanente'=>'Permanente')));?>
<?php echo $form->input("WaterPoll.descripcion");?>
<?php echo $ajax->submit('Guardar', array('url' => array('controller' => 'WaterPolls', 'action' => 'add',$this->data['WaterPoll']['poll_id']), 'update' => 'waters', 'indicator' => 'loadimg','complete'=>'cargar()'));?>
<?php echo $form->end();  ?>
